<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <link rel="stylesheet" href="./css/Element-ui.css" />
  </head>
  <body>
    <div id="app">
      <el-dropdown @command="handleCommand">
        <el-button type="primary">
          更多菜单<i class="el-icon-arrow-down el-icon--right"></i>
        </el-button>
        <el-dropdown-menu slot="dropdown">
          <el-dropdown-item command="黄金糕" key="1">黄金糕</el-dropdown-item>
          <el-dropdown-item command="狮子头">狮子头</el-dropdown-item>
          <el-dropdown-item command="螺蛳粉">螺蛳粉</el-dropdown-item>
          <el-dropdown-item command="双皮奶">双皮奶</el-dropdown-item>
          <el-dropdown-item command="蚵仔煎">蚵仔煎</el-dropdown-item>
        </el-dropdown-menu>
      </el-dropdown>
    </div>
  </body>
  <script src="./js/vue.min.js"></script>
  <script src="./js/Element-ui.min.js"></script>
  <script>
    let v = new Vue({
      el: "#app",
      data: {},
      methods: {
        handleCommand(command, key) {
          switch (command) {
            case "黄金糕":
              this.$message({
                message: "你点击了" + command,
                showClose: true,
                type: "success",
              });
              break;
            case "狮子头":
              this.$message({
                message: "你点击了" + command,
                showClose: true,
                type: "error",
              });
              break;
            case "螺蛳粉":
              this.$message({
                message: "你点击了" + command,
                showClose: true,
                type: "warning",
              });
              break;
            case "双皮奶":
              this.$message({
                message: "你点击了" + command,
                showClose: true,
                type: "info",
              });
              break;
            case "蚵仔煎":
              this.$message({
                message: "你点击了" + command,
                showClose: true,
                type: "success",
              });
              break;
          }
        },
      },
    });
  </script>
</html>
